home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Draw / Sources / Ruler.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  2.4 KB  |  91 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Ruler.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef RULER_H
  11. #define RULER_H
  12.  
  13. #ifndef FWSVIEW_H
  14. #include "FWSView.h"
  15. #endif
  16.  
  17. #ifndef FWRUNTYP_H
  18. #include "FWRunTyp.h"
  19. #endif
  20.  
  21. #ifndef FWSTYLE_H
  22. #include "FWStyle.h"
  23. #endif
  24.  
  25. #ifndef FWFONT_H
  26. #include "FWFont.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Class Definitions
  31. //========================================================================================
  32.  
  33. class FW_CFont;
  34. class FW_CFrame;
  35. class FW_CPictureShape;
  36. class FW_CViewContext;
  37.  
  38. //========================================================================================
  39. //    CLASS CRuler
  40. //========================================================================================
  41.  
  42. class CRuler : public FW_CSuperView
  43. {
  44. public:
  45.     FW_DECLARE_CLASS
  46.     FW_DECLARE_AUTO(CRuler)
  47.     
  48. //----------------------------------------------------------------------------------------
  49. //    Initialization/destruction
  50. //
  51. public:
  52.     virtual ~CRuler();    
  53.  
  54. private:
  55.     CRuler(Environment* ev);
  56.  
  57. //----------------------------------------------------------------------------------------
  58. //    Inherited API
  59. //
  60. public:
  61.     virtual void     Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  62.  
  63.     // ----- Archiving -----
  64.     static void*    Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  65.     static void        Destroy(void* object, FW_ClassTypeConstant type);
  66.     virtual void    Flatten(Environment* ev, FW_CWritableStream& stream) const;
  67.     virtual void    InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  68.     
  69. //----------------------------------------------------------------------------------------
  70. //    New API
  71. //
  72. public:
  73.     void            ZoomFactorChanged(Environment* ev, FW_Fixed zoomFactor);
  74.     
  75. protected:
  76.     void             RenderHorizontalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
  77.     void             RenderVerticalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
  78.     void            RenderGradation(FW_CViewContext& vc,
  79.                                     short gradation, 
  80.                                     const FW_CPoint& pos);
  81.     
  82. //----------------------------------------------------------------------------------------
  83. //    Data Members
  84. //
  85. private:
  86.     FW_CStyle    fLineStyle;
  87.     FW_CFont    fFont;
  88. };
  89.  
  90. #endif
  91.